import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

//导入插件
import plugin from './utils/plugin'
//使用插件
Vue.use(plugin)
//导入语言包
import i18n from '@/lang'
import '@/icons' // icon
import '@/permission' // permission control

//导入过滤器
import * as allFilter from '@/filter/index'
//统一挂载过滤器
Object.keys(allFilter).forEach(item => {
  Vue.filter(item, allFilter[item])
})

//导入打印的插槽
import Print from 'vue-print-nb'
Vue.use(Print)
//统一导入自定义指令
import * as alldir from '@/directive/index'

Object.keys(alldir).forEach(item => {
  Vue.directive(item, alldir[item])
})

Vue.use(ElementUI, {
  i18n: (key, value) => i18n.t(key, value)
})
Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  //给vue添加语言包
  i18n,
  render: h => h(App)
})
